﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace lcs.Web.gradeinfo
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                       
        }

        		protected void btnSave_Click(object sender, EventArgs e)
		{
			
			string strErr="";
			if(!PageValidate.IsNumber(txtmonthsupplyid.Text))
			{
				strErr+="monthsupplyid格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtyls.Text))
			{
				strErr+="原材料及组部件质量控制评价期内格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtyle.Text))
			{
				strErr+="原材料及组部件质量控制出现问题格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtscs.Text))
			{
				strErr+="生产制造工艺控制评价期内质量监格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtsce.Text))
			{
				strErr+="生产制造工艺控制不符合台数格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtscwte1.Text))
			{
				strErr+="生产制造工艺控制制造过程中出现格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtzzs.Text))
			{
				strErr+="组装试验检验已完成试验的总台数格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtzze.Text))
			{
				strErr+="组装试验检验出厂试验一次合格的格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtshs.Text))
			{
				strErr+="收货及检验实际到货的总台数格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtshe.Text))
			{
				strErr+="收货及检验到货验收合格的台数格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtdhs.Text))
			{
				strErr+="到货及时性应到货的总台数格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtdhe.Text))
			{
				strErr+="到货及时性已到货的台数格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtazs.Text))
			{
				strErr+="现场安装设备质量评价期内投运设格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtaze.Text))
			{
				strErr+="现场安装设备质量安装调试期间出格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtazsum.Text))
			{
				strErr+="现场服务质量分优、良、中、差四格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtyxgzs.Text))
			{
				strErr+="运行维护运行设备的总台数格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtyxgze.Text))
			{
				strErr+="运行维护运行中发生故障设备的台格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtyxbfs.Text))
			{
				strErr+="运行维护非正常退役报废率已投运格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtyxbfe.Text))
			{
				strErr+="运行维护非正常退役报废的台数格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtyxsum.Text))
			{
				strErr+="售后服务质量分优、良、中、差四格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtylmark.Text))
			{
				strErr+="原材料及组部件质量控制格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtscmark.Text))
			{
				strErr+="生产制造工艺控制格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtzzmark.Text))
			{
				strErr+="组装试验检验格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtshmark.Text))
			{
				strErr+="收货及检验格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtdhmark.Text))
			{
				strErr+="到货及时性格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtazmark.Text))
			{
				strErr+="现场安装设备质量格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtyxzlmark.Text))
			{
				strErr+="设备质量状况格式错误！\\n";	
			}
			if(!PageValidate.IsDateTime(txtpfdatetime.Text))
			{
				strErr+="评分时间格式错误！\\n";	
			}

			if(strErr!="")
			{
				MessageBox.Show(this,strErr);
				return;
			}
			int monthsupplyid=int.Parse(this.txtmonthsupplyid.Text);
			decimal yls=decimal.Parse(this.txtyls.Text);
			decimal yle=decimal.Parse(this.txtyle.Text);
			decimal scs=decimal.Parse(this.txtscs.Text);
			decimal sce=decimal.Parse(this.txtsce.Text);
			decimal scwte1=decimal.Parse(this.txtscwte1.Text);
			decimal zzs=decimal.Parse(this.txtzzs.Text);
			decimal zze=decimal.Parse(this.txtzze.Text);
			decimal shs=decimal.Parse(this.txtshs.Text);
			decimal she=decimal.Parse(this.txtshe.Text);
			decimal dhs=decimal.Parse(this.txtdhs.Text);
			decimal dhe=decimal.Parse(this.txtdhe.Text);
			decimal azs=decimal.Parse(this.txtazs.Text);
			decimal aze=decimal.Parse(this.txtaze.Text);
			decimal azsum=decimal.Parse(this.txtazsum.Text);
			decimal yxgzs=decimal.Parse(this.txtyxgzs.Text);
			decimal yxgze=decimal.Parse(this.txtyxgze.Text);
			decimal yxbfs=decimal.Parse(this.txtyxbfs.Text);
			decimal yxbfe=decimal.Parse(this.txtyxbfe.Text);
			decimal yxsum=decimal.Parse(this.txtyxsum.Text);
			decimal ylmark=decimal.Parse(this.txtylmark.Text);
			decimal scmark=decimal.Parse(this.txtscmark.Text);
			decimal zzmark=decimal.Parse(this.txtzzmark.Text);
			decimal shmark=decimal.Parse(this.txtshmark.Text);
			decimal dhmark=decimal.Parse(this.txtdhmark.Text);
			decimal azmark=decimal.Parse(this.txtazmark.Text);
			decimal yxzlmark=decimal.Parse(this.txtyxzlmark.Text);
			DateTime pfdatetime=DateTime.Parse(this.txtpfdatetime.Text);

			lcs.Model.gradeinfo model=new lcs.Model.gradeinfo();
			model.monthsupplyid=monthsupplyid;
			model.yls=yls;
			model.yle=yle;
			model.scs=scs;
			model.sce=sce;
			model.scwte1=scwte1;
			model.zzs=zzs;
			model.zze=zze;
			model.shs=shs;
			model.she=she;
			model.dhs=dhs;
			model.dhe=dhe;
			model.azs=azs;
			model.aze=aze;
			model.azsum=azsum;
			model.yxgzs=yxgzs;
			model.yxgze=yxgze;
			model.yxbfs=yxbfs;
			model.yxbfe=yxbfe;
			model.yxsum=yxsum;
			model.ylmark=ylmark;
			model.scmark=scmark;
			model.zzmark=zzmark;
			model.shmark=shmark;
			model.dhmark=dhmark;
			model.azmark=azmark;
			model.yxzlmark=yxzlmark;
			model.pfdatetime=pfdatetime;

			lcs.BLL.gradeinfo bll=new lcs.BLL.gradeinfo();
			bll.Add(model);
			Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功！","add.aspx");

		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
